/*
 * @Description: 层级列表
 * @Author: Rfan
 * @Date: 2022-01-25 18:02:15
 * @LastEditTime: 2023-01-19 14:19:50
 */

import { useState } from 'react';
import classNames from 'classnames/bind';
import RecordLevel from './RecordLevel';
import ERecordLevel from './ERecordLevel';
import styles from '../styles/fileLevelTable.module.scss';

const cx = classNames.bind(styles);

const RecordLevelTable = () => {
  // 电子文件级层级信息
  const [eRecordInfo, setERecordInfo] = useState<any>({ downLevel: {}, record: {} });

  /**
   * @description: RecordTable 文件表格变动触发方法
   */
  const recordSelectChange = (downLevel: number, record: any) => {
    setERecordInfo({ downLevel, record });
  };

  return (
    <>
      <div className={cx('file-pane')}>
        <RecordLevel selectChange={recordSelectChange} />
      </div>
      <div className={cx('file-pane')}>
        <ERecordLevel levelParams={eRecordInfo.downLevel} data={eRecordInfo.record} />
      </div>
    </>
  );
};

export default RecordLevelTable;
